cmake_minimum_required(VERSION 2.8.3)
project(moying_costmap)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
SET(CMAKE_BUILD_TYPE Release)
#SET(CMAKE_BUILD_TYPE Debug)

find_package(catkin REQUIRED COMPONENTS
  moying_navigation_msgs
  utilities
)

find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)


catkin_package(
  INCLUDE_DIRS include
  LIBRARIES moying_costmap
  CATKIN_DEPENDS moying_navigation_msgs utilities
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${SDL_INCLUDE_DIR}
  ${SDL_IMAGE_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME}
  src/${PROJECT_NAME}/moying_costmap.cpp
)

add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME}
  ${catkin_LIBRARIES}
  ${SDL_LIBRARY}
  ${SDL_IMAGE_LIBRARIES}
)


#配置包含的头文件（安装后可在/opt/ros/kinetic/include/${PROJECT_NAME}路径下找到该头文件）
install(DIRECTORY include/${PROJECT_NAME}/

  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}

)

## Mark executables and/or libraries for installation
install(TARGETS ${PROJECT_NAME} 
   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)